// element.cpp
#include "element.h"

float getElementEffectiveness(Element attacker, Element defender) {
    switch (attacker) {
    case Element::Water:
        if (defender == Element::Fire || defender == Element::Steel) return 1.5f;
        break;
    case Element::Grass:
        if (defender == Element::Water || defender == Element::Rock) return 1.5f;
        break;
    case Element::Fire:
        if (defender == Element::Grass || defender == Element::Steel) return 1.5f;
        break;
    case Element::Steel:
        if (defender == Element::Grass || defender == Element::Rock) return 1.5f;
        break;
    case Element::Rock:
        if (defender == Element::Fire || defender == Element::Water) return 1.5f;
        break;
    default:
        break;
    }
    return 1.0f; // 默认无修正
}
